<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    {js:jquery}
    {js:validate}
    {js:dialog}
    {js:artTemplate}
    {js:form}
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
    <link href="{webroot:public/css/twitter-bootstrap/3.3.7/css/bootstrap.min.css}" rel="stylesheet">
    <script type='text/javascript' src='{webroot:public/javascript/public.js}'></script>
</head>

<body>
<div class="container">
    <form action='{url:/seller/ad_position_del}' method='post' name='adPositionForm'>
        <table class="table table-bordered">
        <caption>
            <input type="button" onclick="window.location.href='{url:/seller/ad_position_edit}';" class="btn btn-success" value="添加广告位" />
            <input type="button" onclick="selectAll('id[]')" class="btn btn-info" value="全选" />
            <input type="button" onclick="delModel({'form':'adPositionForm','link':'{url:/seller/ad_position_del}','name':'id[]'})" class="btn btn-danger" value="批量删除" />
        </caption>

        <colgroup>
            <col width="50px" />
            <col width="180px" />
            <col />
            <col width="150px" />
        </colgroup>

        <thead>
        <tr>
            <th></th>
            <th>名称</th>
            <th>宽×高</th>
            <th>播放方式</th>
            <th>开启状态</th>
            <th>操作</th>
        </tr>
        </thead>

        <tbody>
        {set:$queryObj=Api::run('getAdPositionList');$resultData=$queryObj->find()}
        {foreach:items=$resultData}
        <tr>
            <td><input type='checkbox' name='id[]' value='{$item['id']}' /></td>
            <td>{$item['name']}</td>
            <td>{$item['width']}×{$item['height']}</td>
            <td>{echo:$item['fashion']==1 ? '轮回显示':'随机显示'}</td>
            <td>{echo:$item['status']==1 ? '是':'否'}</td>
            <td>
                <button type="button" class="btn btn-success glyphicon glyphicon-plus" alt="添加广告数据" title="添加广告数据" onclick="window.location.href='{url:/seller/ad_edit/pid/$item['id']}';"></button>
                <button type="button" class="btn btn-success glyphicon glyphicon-edit" alt="修改广告数据" title="修改广告数据" onclick="window.location.href='{url:/seller/ad_position_edit/id/$item['id']}';"></button>
                <button type="button" class="btn btn-danger glyphicon glyphicon-remove" alt="删除广告位" title="删除广告位" onclick="delModel({link:'{url:/seller/ad_position_del/id/$item['id']}'})"></button>
            </td>
        </tr>
        {/foreach}
        </tbody>
    </table>
    </form>
    {$queryObj->getPageBar()}
</div>
</body>
</html>